/**
 *
 */
package name.yzhu.wbdata.db.model;

import java.io.Serializable;
import java.util.Date;

/**
 * @author yhzhu
 *
 */
public class Status implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 6953786409131646858L;

	private String id;

	private Date createdAt;

	private String text;

	private String retweetedID;

	private Integer repostsCount; //转发数

	private Integer commentsCount;

	private String url;

	private String sourceName;

	private String sourceRelationship;

	private String uid;

	/**
	 * 1 : public time line
	 * 2 : friend time line
	 */
	private Integer type;

	public Status(){}

	public Status(weibo4j.model.Status s) {
		this.id = s.getId();
		this.createdAt = s.getCreatedAt();
		this.text = s.getText();

		if (s.getRetweetedStatus() != null)
		  this.retweetedID = s.getRetweetedStatus().getId();

		this.repostsCount = s.getRepostsCount();
		this.commentsCount = s.getCommentsCount();

		if (s.getUser() != null)
		    this.uid = s.getUser().getId();

		if (s.getSource() != null) {
			this.url = s.getSource().getUrl();
			this.sourceName = s.getSource().getName();
			this.sourceRelationship = s.getSource().getRelationship();
		}

	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getRetweetedID() {
		return retweetedID;
	}

	public void setRetweetedID(String retweetedID) {
		this.retweetedID = retweetedID;
	}

	public Integer getRepostsCount() {
		return repostsCount;
	}

	public void setRepostsCount(Integer repostsCount) {
		this.repostsCount = repostsCount;
	}

	public Integer getCommentsCount() {
		return commentsCount;
	}

	public void setCommentsCount(Integer commentsCount) {
		this.commentsCount = commentsCount;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getUid() {
		return uid;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getUrl() {
		return url;
	}

	public void setSourceName(String sourceName) {
		this.sourceName = sourceName;
	}

	public String getSourceName() {
		return sourceName;
	}

	public void setSourceRelationship(String sourceRelationship) {
		this.sourceRelationship = sourceRelationship;
	}

	public String getSourceRelationship() {
		return sourceRelationship;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getType() {
		return type;
	}

	@Override
	public String toString() {
		return "Status [id=" + id + ", createdAt=" + createdAt + ", text="
				+ text + ", retweetedID=" + retweetedID + ", repostsCount="
				+ repostsCount + ", commentsCount=" + commentsCount + ", url="
				+ url + ", sourceName=" + sourceName + ", sourceRelationship="
				+ sourceRelationship + ", uid=" + uid + ", type=" + type + "]";
	}

}
